﻿/*
Post-Deployment Script Template							
--------------------------------------------------------------------------------------
 This file contains SQL statements that will be appended to the build script.		
 Use SQLCMD syntax to include a file in the post-deployment script.			
 Example:      :r .\myfile.sql								
 Use SQLCMD syntax to reference a variable in the post-deployment script.		
 Example:      :setvar TableName MyTable							
               SELECT * FROM [$(TableName)]					
--------------------------------------------------------------------------------------
*/
print 'Insert infrastructure application...'
INSERT INTO [BPMEngine].[dbo].[Applications]
           ([ApplicationId]
           ,[ApplicationName]
           ,[Description])
     VALUES
           (
           1,
           'Infrastructure Tests Application',
           'Infrastructure Tests Application'
           );

GO
print 'Insert another test application...'
INSERT INTO [BPMEngine].[dbo].[Applications]
           ([ApplicationId]
           ,[ApplicationName]
           ,[Description])
     VALUES
           (
           2,
           'Another Tests Application',
           'Another Tests Application'
           );

GO

print 'Insert scrum factory application...'
INSERT INTO [BPMEngine].[dbo].[Applications]
           ([ApplicationId]
           ,[ApplicationName]
           ,[Description])
     VALUES
           (
           3,
           'Scrum Factory Application',
           'Scrum Factory Application'
           );

GO
print 'Insert infrastructure process definitions groups...'
INSERT INTO [BPMEngine].[dbo].[ProcessDefinitionGroups]
			(
				[ProcessDefinitionGroupId], 
				[GroupName], 
				[GroupDescription], 
				[ParentGroupId],
				[ApplicationId])
	  VALUES
			(
			1,
			'Infrastructure Tests Processes',
			'Infrastructure Tests Processes',
			null,
			1);

GO

INSERT INTO [BPMEngine].[dbo].[ProcessDefinitionGroups]
			(
				[ProcessDefinitionGroupId], 
				[GroupName], 
				[GroupDescription], 
				[ParentGroupId],
				[ApplicationId])
	  VALUES
			(
			2,
			'Infrastructure OrgUnit Tests Processes',
			'Infrastructure OrgUnit Tests Processes',
			1,
			1);

GO
print 'Insert infrastructure process definitions...'
INSERT INTO [BPMEngine].[dbo].[ProcessDefinitions]
           ([ProcessDefinitionId]
           ,[ProcessDefinitionName]
           ,[ProcessDefinitionDescription]
           ,[SLA]
           ,[WorkflowXaml]
		   ,[ProcessDefinitionGroupId])
     VALUES
           (
		   1,
           'InfrastructureTestProcess',
           'Infrastructure test process',
           7,
           'Tests\InfrastructureTestProcess.xaml',
		   1);

INSERT INTO [BPMEngine].[dbo].[ProcessDefinitions]
           ([ProcessDefinitionId]
           ,[ProcessDefinitionName]
           ,[ProcessDefinitionDescription]
           ,[SLA]
           ,[WorkflowXaml]
		   ,[ProcessDefinitionGroupId])
     VALUES
           (
		   2,
           'InfrastructureSimpleSingleApprovalProcess',
           'Infrastructure simple single approval process',
           7,
           'Tests\InfrastructureSimpleSingleApprovalProcess.xaml',
		   1);

INSERT INTO [BPMEngine].[dbo].[ProcessDefinitions]
           ([ProcessDefinitionId]
           ,[ProcessDefinitionName]
           ,[ProcessDefinitionDescription]
           ,[SLA]
           ,[WorkflowXaml]
		   ,[ProcessDefinitionGroupId])
     VALUES
           (
		   3,
           'InfrastructureSimpleSerialApprovalProcess',
           'Infrastructure simple serial approval process',
           21,
           'Tests\InfrastructureSimpleSerialApprovalProcess.xaml',
		   1);

GO
print 'Insert infrastructure property definitions...'

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (1,
           'TestStringProperty',
           'Test String Property',
           'Test String Property',
		   'Test String Property',
           1);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (2,
           'TestLongProperty',
           'Test Long Property',
           'Test Long Property',
		   'Test Long Property',
           2);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (3,
           'TestIntegerProperty',
           'Test Integer Property',
           'Test Integer Property',
		   'Test Integer Property',
           3);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (4,
           'TestDoubleProperty',
           'Test Double Property',
           'Test Double Property',
		   'Test Double Property',
           4);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (5,
           'TestDecimalProperty',
           'Test Decimal Property',
           'Test Decimal Property',
		   'Test Decimal Property',
           5);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (6,
           'TestDateTimeProperty',
           'Test DateTime Property',
           'Test DateTime Property',
		   'Test DateTime Property',
           6);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (7,
           'TestBooleanProperty',
           'Test Boolean Property',
           'Test Boolean Property',
		   'Test Boolean Property',
           7);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (8,
           'TestAddressProperty',
           'Test Address Property',
           'Test Address Property',
		   'Test Address Property',
           8);

INSERT INTO [BPMEngine].[dbo].[PropertyDefinitions]
           ([PropertyDefinitionId]
		   ,[PropertyKey]
           ,[PropertyName]
           ,[PropertyDescription]
           ,[PropertyDisplayName]
           ,[DataType])
     VALUES
           (9,
           'DelayTimeInMilliseconds',
           'Delay Time In Milliseconds',
           'Delay Time In Milliseconds',
		   'Delay Time In Milliseconds',
           2);
GO
print 'Insert infrastructure property mappings...'
INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(1,1,1,1,1,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(2,1,1,1,2,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(3,1,1,1,3,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(4,1,1,1,4,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(5,1,1,1,5,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(6,1,1,1,6,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(7,1,1,1,7,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(8,1,1,1,8,1,1);

INSERT INTO [BPMEngine].[dbo].[PropertyMappings]
           ([PropertyMappingId]
           ,[IsEditable]
           ,[IsVisible]
           ,[IsRequired]
           ,[PropertyDefinitionId]
           ,[PrototypedObjectType]
           ,[PrototypedObjectId])
     VALUES(9,1,1,1,9,1,1);

GO